<?php 
include 'apache-log-parser.php'; 

$apache_log_parser = new apache_log_parser(); // Create an apache log parser 

if ($apache_log_parser->open_log_file('a.log')) // Make sure it opens the log file 
{ 
          while ($line = $apache_log_parser->get_line()) 
          {
                  echo $line;
                  echo "==========\n";
                  $parsed_line = $apache_log_parser->format_line($line); // format the line 
                  print_r($parsed_line); // print out the array 
          } 
          $apache_log_parser->close_log_file(); // close the log file 
} 
else 
{ 
          echo 'Sorry cannot open log file.'; 
} 


?>